using System.Collections.Generic;
using Caliburn.Micro;
using Hayabusa._Chauffeurs.DAO;
using Hayabusa.Database;

namespace Hayabusa._Chauffeurs
{
    public class AfficherViewModel : Screen
    {
        private readonly ChauffeurDao _chauffeurDao = new ChauffeurDao();

        private List<Chauffeurs> _chauffeurs;

        #region CAN pour caliburn
        #endregion

        #region GETTER/SETTER pour le binding caliburn

        public List<Chauffeurs> Chauffeurs
        {
            get { return _chauffeurs; }
            set
            {
                _chauffeurs = value;
                NotifyOfPropertyChange("Chauffeurs");
            }
        }

        #endregion

        protected override void OnActivate()
        {
            Chauffeurs = _chauffeurDao.FindAll();
            base.OnActivate();
        }
    }
}